/**
 * Created by hythzx on 2016/6/23.
 */


$(document).ready(function () {



    $("#voyage").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        if(!company){
            layer.open({
                id:'voyageLayer',
                type: 2,
                title: '航次计划报告',
                shadeClose: true,
                shade: 0,
                maxmin: true,
                area: ['970px', windowHeight + 'px'],
                content: basePath+'/manage/map/voyage' //iframe的url
            });
        }else{
            layer.open({
                type: 2,
                id:'voyageLayer',
                title: '航次计划报告',
                shadeClose: true,
                shade: 0,
                maxmin: true,
                area: ['970px', windowHeight + 'px'],
                content: basePath+'/manage/map/company/voyage' //iframe的url
            });
        }
        
    });

    $("#accident").click(function () {

        var windowHeight = document.body.clientHeight - 150;
        if(!company){
            layer.open({
                type: 2,
                id:'accidentLayer',
                title: '事故险情报告',
                shadeClose: true,
                shade: 0,
                maxmin: true,
                area: ['970px', windowHeight + 'px'],
                content: basePath+'/manage/map/accident' //iframe的url
            });
        }else{
            layer.open({
                type: 2,
                id:'accidentLayer',
                title: '事故险情报告',
                shadeClose: true,
                shade: 0,
                maxmin: true,
                area: ['970px', windowHeight + 'px'],
                content: basePath+'/manage/map/company/accident' //iframe的url
            });
        }

    });

    $("#message").click(function () {
        var windowHeight = document.body.clientHeight -350;
        if(!company){
            layer.open({
                type: 2,
                id:'messageLayer',
                title: '发布消息',
                shadeClose: true,
                shade: 0,
                maxmin: true,
                area: ['400px', windowHeight + 'px'],
                content: basePath+'/manage/map/message' //iframe的url
            });
        }else{
            layer.open({
                type: 2,
                id:'messageLayer',
                title: '发布消息',
                shadeClose: true,
                shade: 0,
                maxmin: true,
                area: ['970px', windowHeight + 'px'],
                content: basePath+'/manage/map/company/message' //iframe的url
            });
        }
    });

    $("#fleet").click(function(){
        if(company){
            layer.open({
                type:2,
                id:'focusShip',
                title:"关注船舶",
                shadeClose: true,
                shade: 0,
                maxmin: true,
                offset : ['80px','8px'],
                area: ['360px', '420px'],
                content: basePath+'/ship/guanzhu/select'
            });
        }
    });

    $("#company-warning").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'companyWarningLayer',
            title: '告警信息',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            offset : ['80px','8px'],
            area: ['360px', '420px'],
            content: basePath+'/manage/map/company/warning' //iframe的url
        });
    });



    $("#warning").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'warningLayer',
            title: '警告信息',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            area: ['970px', windowHeight + 'px'],
            content: basePath+'/manage/map/navigate/warning' //iframe的url
        });
    });

    $("#aisShip").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        var offset
        if(mapType=="one"){
            offset='lt'
        }
        layer.open({
            type: 2,
            id:'aisShipLayer',
            title: 'AIS船舶',
            shadeClose: true,
            shade: 0,
             maxmin: true,
            offset : offset,
            area: ['600px', '400px'],
            content: basePath+'/manage/map/company/aisShip' //iframe的url
        });
    });

    $("#gpsShip").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'gpsShipLayer',
            title: '自有船舶',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            offset : ['0px','0px'],
            area: ['250px', '400px'],
            content: basePath+'/manage/map/company/cyxShip' //iframe的url
        });
    });




    $("#shipList").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'shipListLayer',
            title: '船舶列表',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            offset : ['30px','0px'],
            area: ['250px', '400px'],
            content: basePath+'/manage/map/cyxShip' //iframe的url
        });
    });


    $("#findShip").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'findShipLayer',
            title: '船舶搜索 ',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            offset : ['30px','0px'],
            area: ['800px', '300px'],
            content: basePath+'/manage/map/aisShip' //iframe的url
        });
    });

    $("#touchLine").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'touchLineLayer',
            title: '报告线记录',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            offset : ['30px','0px'],
            area: ['500px', '400px'],
            content: basePath+'/manage/map/touchLine' //iframe的url
        });
    });
    $("#watersManager").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'watersManage',
            title: '水域管理',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            offset : ['30px','0px'],
            area: ['700px', '400px'],
            content: basePath+'/manage/map/waters' //iframe的url
        });
    });

    $("#alarmMarker").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'watersManage',
            title: 'VTS管理',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            offset : ['30px','0px'],
            area: ['700px', '500px'],
            content: basePath+'/manage/map/vts' //iframe的url
        });
    });
    $("#reportLineInfo").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'reportLineManage',
            title: '报告线管理',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            offset : ['30px','0px'],
            area: ['700px', '400px'],
            content: basePath+'/manage/reportline/info' //iframe的url
        });
    });

    $("#serverPoint").click(function () {
        var windowHeight = document.body.clientHeight - 150;

        layer.open({
            type: 2,
            id:'serverPointLayer',
            title: '服务点',
            shadeClose: true,
            shade: 0,
            offset : ['0px','0px'],
            maxmin: true,
            area: ['250px','400px'],
            content: basePath+'/manage/map/company/ship/serverPoint' //iframe的url
        });
    });

    $("#serverShip").click(function () {
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'serverShipLayer',
            title: '服务船舶',
            shadeClose: true,
            shade: 0,
            offset : ['0px','0px'],
            maxmin: true,
            area: ['250px','400px'],
            content: basePath+'/manage/map/company/ship/serverShip' //iframe的url
        });
    });
    
    
    $("#serverPointCheck").click(function(){
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'serverPointCheckLayer',
            title: '服务点审核',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            area: ['820px',  '400px'],
            content: basePath+'/manage/map/serverPointCheck' //iframe的url
        });
    });


    $("#serverShipCheck").click(function(){
        var windowHeight = document.body.clientHeight - 150;
        layer.open({
            type: 2,
            id:'serverShipCheckLayer',
            title: '服务船舶审核',
            shadeClose: true,
            shade: 0,
            maxmin: true,
            area: ['820px',  '400px'],
            content: basePath+'/manage/map/serverShipCheck' //iframe的url
        });
    });
});


